package com.ymatou.iapi.quickturnover.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*创建提前放款批次接口Call
*FreeMaker Template自动生成代码
*/
public class ApplyAdvanceBillCall extends YmatouBaseCall{
	private static String opurl ="/api/ApplyAdvanceBill";
	
	public ApplyAdvanceBillCall() {
		super(EnvSetup.getSystemUrl("quickturnover_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	/**
	 * 获取code
	 * 
	 * @return
	 */
	public String getCode() {
		String code = null;
		try {
			code = new JSONObject(getReturnData()).getString("code");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return code;
	}
	/**
	 * 获取bcode
	 * 
	 * @return
	 */
	public String getBcode() {
		String bcode =null;
		try {
			bcode = new JSONObject(getReturnData()).getString("bcode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return bcode;
	}
	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public JSONObject getData() {
		JSONObject Data = null;
		try {
			Data = new JSONObject(getReturnData()).getJSONObject("data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}
	
	
}